<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>
		<script>
			let user = window.prompt('请输入剪刀或石头或布（0代表剪刀1代表石头2代表布）)');
			let computer = Math.floor(Math.random() * 3);
			if (user == 0 && computer == 1 && user < computer) {
				console.log('电脑出了石头，你输了');
			} else if (user == 1 && computer == 2 && user < computer) {
				console.log('电脑出了布，你输了');
			} else if (user == 2 && computer == 0 && user > computer) {
				console.log('电脑出了剪刀，你输了');
			} else if (user == 1 && computer == 1 && user == computer || user == 2 && computer == 2 && user == computer || user ==
				3 && computer == 3 && user == computer) {
				console.log('平局');
			} else {
				console.log(`你赢了`);
			}
		</script>
	</body>
</html>
